package com.cloud.pole.user.model.entity.account;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.validator.constraints.NotEmpty;

import lombok.Data;

/**
 * @author 
 */
@Table(name="user_account")
@Data
public class UserAccount implements Serializable {
	/**
	 * 账户状态（-1：注销  0：无效 1 正常 ）
	 */
	public static final int USER_ACCOUNT_STATUS_OK  = 1;
	public static final int USER_ACCOUNT_STATUS_INVALID = 0;
	public static final int USER_ACCOUNT_STATUS_CANCEL = -1;

	public static final int BALANCE_DIRECTION_PLUS = 1;    //增加余额
	public static final int BALANCE_DIRECTION_REDUCE = -1; //减少余额
	
    /**
     * 账目ID
     */
    @Id
    @Column(name="type_id")
    private Long accountId;

    /**
     * 用户id
     */
    @NotEmpty
    private Long userId;

    /**
     * 用户名
     */
    @NotEmpty
    private String userName;

    /**
     * 账目类型id
     */
    @NotEmpty
    private Integer typeId;

    /**
     * 账户状态（-1：注销  0：无效 1 正常 ）
     */
    @NotEmpty
    private Integer accountStatus;

    /**
     * 账目卡号
     */
    private String accountNumber;

    /**
     * 账目余额
     */
    @NotEmpty
    private BigDecimal accountBalance;

    /**
     * 更新日期
     */
    private Date updateTime;

    /**
     * 创建日期
     */
    private Date createTime;

    private static final long serialVersionUID = 1L;
}